<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title>DASHBOARD</title>
	<!-- Bootstrap -->
	<link href="#(ctx)/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet">
	<link rel="stylesheet" href="/assets/bootstrap_table/bootstrap-table.css" />
	<link href="#(ctx)/assets/font-awesome/css/font-awesome.min.css" rel="stylesheet">


	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
	<script src="#(ctx)/assets/jquery/jquery.min-3.3.1.js"></script>
	
	<script src="#(ctx)/assets/bootstrap/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="#(ctx)/assets/bootstrap_table/bootstrap-table.js" ></script>
	<script type="text/javascript" src="#(ctx)/assets/bootstrap_table/locale/bootstrap-table-zh-CN.js" ></script>

	<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
	<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
	<!--[if lt IE 9]>
	<script src="#(ctx)/assets/bootstrap/js/html5shiv.min.js"></script>
	<script src="#(ctx)/assets/bootstrap/js/respond.min.js"></script>
	<![endif]-->
	
	<style>
	body{
		font-size:32px;
	}
	.content-box{
		position: absolute;
		top: 0px;
		left: 0;
		right: 0;
		bottom: 0;
		padding: 10px;
	}
	 .hidden{display:none;}
	</style>
</head>
<body >
    <div class="content-box" id="content-box">
	<table id="enterTable" class="table-borderless">
	</table>
	</div>
	<script type="text/javascript">
	$('#enterTable').bootstrapTable({
        url: '#(ctx)/tvin/list',         
        method: 'post',
        undefinedText:'',
        paginationDetailHAlign:' hidden',
       	height: $("#content-box").height(),
        columns: [
            {
                field: 'hanger_no',  title: '挂具编号'
            },  {
            	field: 'barcode',  title: '条码号'
            },  {
                field: 'material_no',  title: '物料编号'
            }, {
                field: 'material_count',  title: '数量',formatter:materialCountFormatter
            },{
            	field: 'update_time', title: '扫描时间',formatter:dateFormatter
            },{
            	field: 'remark', title: ' ',formatter:sacnnerFormatter
            }
        ],
        rowStyle:rowStyler,
        sidePagination: "server",
        pagination: true
    });

	//$('#exitTable').bootstrapTable('togglePagination');
	function employeeFormatter(value, row, index){
		if(row.employeeNumber==""){
			return "-";
		}
		return row.realName+"("+row.employeeNumber+")";
	}

	function materialCountFormatter(value, row, index){
	   if(value<0){
	     return '';
	   }
	   return value;
	}

	function dateFormatter(value, row, index){
		if(value){
			return value.substring(5,19);
		}else{
			return "";
		}
	}
	
	function rowStyler(row, index){
		var style = {};            
		var status=row.type;
		if(status==1){
        	style={css:{'background-color':'#F9F9F9'}};
		}else {
			style={css:{'background-color':'#98FB98'}};
		}
    	return style;
	}

	function sacnnerFormatter(value, row, index){
		  return "-"
		
		}
	
	function refresh(){
		$('#enterTable').bootstrapTable("refresh",{silent: true});
	}

	setInterval("refresh()",2000);
	
	</script>
</body>
</html>
